﻿@model ZDSoft.QLMS.Entity.Question
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Update</title>
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <link href="../../Scripts/PageCreater/Css/Style.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/zTree/js/jquery.ztree.core-3.5.js" type="text/javascript"></script>
    <script src="../../Scripts/zTree/js/jquery.ztree.exedit-3.5.js" type="text/javascript"></script>
    <script src="../../Scripts/zTree/js/jquery.ztree.excheck-3.5.js" type="text/javascript"></script>
    <link href="../../Scripts/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        var i = 0;
        var ID = 0;
        function SetValue(id) {
            ID = id;
        }
        $(document).ready(function () {
            var Text = $("#Type").val();
            if (Text != "单选题" && Text != "多选题") {
                document.getElementById("options").style.display = 'none';
            }
            else {
                document.getElementById("options").style.display = '';
            }
        });
        function SubmitPage() {
            var id = $("#id").val();
            var item = $(":input:checked");
            var len = item.length;
            var activeinfo = true;
            if (len > 0) {
                $("#exams").val("true");
            }
            else {
                $("#exams").val("false");
            }
            var ispass = $("#exams").val();
            var auditOpinion = $("#suggestion").val();
            $.ajax({
                type: "Post",
                url: "/QuestionExam/UpdateWithdraw",
                data: { id: $("#id").val(), activeinfo: ispass, AuditOpinion: auditOpinion },
                success: function () {
                    alert("提交完成！");
                }
            });
        };
    </script>
</head>
<body>
    @{
        var i = 65;
    }
    <div class="zTreeDemoBackground left" style="float: right; width: auto; height: auto;
        font-size: 13px;">
        本题知识点:
        <input disabled="disabled" type="text" id="selectName" value="@Model.KnowledgePoint.Name" style="font-size: 13px;" />
    </div>
    <input value="@Model.ID" type="hidden" id="id" />
    <div class="content_top">
        <div>
            题型:
            <input disabled="disabled" value="@Model.Type.Name" id="Type" />
            <br />
            <br />
        </div>
    </div>
    <div>
        难易程度：
        @if (Model.Degree.ToString() == "Harder")
        {
            <input disabled="disabled" value="非常难" id="harder_id" />
        }
        else if (Model.Degree.ToString() == " Normal")
        {
            <input disabled="disabled" value="一般" id="Normal_id" />
        }
        else if (Model.Degree.ToString() == " Hard")
        {
            <input disabled="disabled" value="难" id="Hard_id" />
        }
        else
        {
            <input disabled="disabled" value="简单" id="easy_id" />   
        }
        <div class="content_center">
            <div>
                <div style="margin-top: 10px; margin-left: 10px;">
                    <span>题目：</span><input id="Title" disabled="disabled" type="text" style="width: 500px; height: 50px;" value="@Model.Title" /><br />
                    <br />
                    <div>
                    </div>
                </div>
                <div style="margin-left: 10px;">
                    <div id="options">
                        <table>
                            <tr>
                                <td>
                                    <span>选项：</span>
                                    @foreach (ZDSoft.QLMS.Entity.Answer answer in @Model.Answers)
                                    { 
                                        <br /> <br />
                                        <input id="option-@i" disabled="disabled"  type="text" value="@answer.SerialNumber" style="width: 30px;" /><span>描述:</span><input
                                     disabled="disabled"  id="dis-@i" value="@answer.Content" type="text" style="width: 200px;" />
                                        
                                                                        i++;
                                    }
                                </td>
                            </tr>
                        </table>
                        <div id="LOL">
                        </div>
                    </div>
                    <div id="answers">
                        <br />
                        <br />
                        <span>答案：</span>
                        @{string str = "";}
                        @foreach (ZDSoft.QLMS.Entity.Answer answer in @Model.Answers)
                        {
                            if (@Model.Type.Name == "单选题" || @Model.Type.Name == "多选题" || @Model.Type.Name == "选择题")
                            {
                                if (answer.IsCorrect == true)
                                {
                                    str += answer.SerialNumber + ",";
                                }
                            }
                            else
                            {
                                str += answer.Content + ",";
                            }
                        }
                        @{str = str.Substring(0, str.Length - 1);}
                        <input disabled="disabled" id="Answers" type="text" style="width: 500px; height: 50px;"
                                value="@str" />
                    </div>
                </div>
            </div>
        </div>
        <br />
             <fieldset style="float: left; width: 100%; height: 100px;border:0;">
                <legend >审核意见</legend>
               <textarea style="height: 60px; width: 52%; overflow-x:hidden;overflow-y:hidden"" id="suggestion" rows="1" cols="1">@TempData["auditOpinion"]</textarea>
            </fieldset>
        <input type="checkbox" id="exam" checked="checked" />
        是否通过审核
        <input type="hidden" value="" id="exams" />
        <div class="down">
            <input type="button" value="审核" class="btn3" style="margin: 20px;" onclick="SubmitPage()" />
        </div>
    </div>
</body>
</html>
